package com.example.test04.service.impl;

import com.example.test04.entity.Classroom;
import com.example.test04.repository.ClassroomRepository;
import com.example.test04.service.ClassroomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassroomServiceImpl implements ClassroomService {
    @Autowired
    private ClassroomRepository classroomRepository;
    @Override
    public Classroom save(Classroom classroom) {
        return classroomRepository.save(classroom);
    }
    @Override
    public void delete(int id) {
        classroomRepository.deleteById(id);
    }

    @Override
    public List<Classroom> findAll() {
        return (List<Classroom>) classroomRepository.findAll();
    }
}
